//
// Copyright (C) [2024] Xingyun Integrated Circuit, Inc.
//
// GreenCode was a private technology asset of Xingyun Integrated Circuit， Inc （Confidential）
//  Author: Shawn.Tan
//  Date : 2025.10.28
//
//  History : Initial Version 2025.10.28
//
//
#ifndef Green_ThreadContext_H
#define Green_ThreadContext_H

#include "Defines.h"

namespace Green {

  /*!
    \class ThreadContext
    \brief Scoped call guard for multithreaded access.
  */
  class ThreadContext {
  public:
    ThreadContext(); //!< Constructor
    COPY_CONSTRUCTOR_ABSENT(ThreadContext);
    ~ThreadContext(); //!< Destructor
    ASSIGNMENT_OPERATOR_ABSENT(ThreadContext);

    uint32 GetThreadId() const; //!< Return the thread ID for the calling execution thread.
  };

  /*!
    \class ThreadContextNoAdvance
    \brief Scoped call guard for multithreaded access that doesn't advance the scheduled thread.
  */
  class ThreadContextNoAdvance {
  public:
    ThreadContextNoAdvance(); //!< Constructor
    COPY_CONSTRUCTOR_ABSENT(ThreadContextNoAdvance);
    ~ThreadContextNoAdvance(); //!< Destructor
    ASSIGNMENT_OPERATOR_ABSENT(ThreadContextNoAdvance);

    uint32 GetThreadId() const; //!< Return the thread ID for the calling execution thread.
  };

}

#endif  // Green_ThreadContext_H
